package com.sokal.easycare.modules.contract.service;

import java.util.List;

import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sokal.easycare.common.persistence.Page;
import com.sokal.easycare.common.service.CrudService;
import com.sokal.easycare.modules.contract.entity.ContractTemplate;
import com.sokal.easycare.modules.contract.dao.ContractTemplateDao;

/**
 * 合同模板Service
 * @author liliangdong
 * @version 2017-04-13
 */
@Service
@Transactional(readOnly = true)
public class ContractTemplateService extends CrudService<ContractTemplateDao, ContractTemplate> {

	public ContractTemplate get(String id) {
		return super.get(id);
	}
	
	public List<ContractTemplate> findList(ContractTemplate contractTemplate) {
		return super.findList(contractTemplate);
	}
	
	public Page<ContractTemplate> findPage(Page<ContractTemplate> page, ContractTemplate contractTemplate) {
		return super.findPage(page, contractTemplate);
	}
	
	@Transactional(readOnly = false)
	public void save(ContractTemplate contractTemplate) {
		//contractTemplate.setContent(StringEscapeUtils.unescapeHtml4(contractTemplate.getContent()));
		super.save(contractTemplate);
	}
	
	@Transactional(readOnly = false)
	public void delete(ContractTemplate contractTemplate) {
		super.delete(contractTemplate);
	}
	
}